package com.xiaoxin.errorDemo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("error")
public class ErrorController {
    @GetMapping("page")
    public String getErrorPage() throws Exception {
        throw new Exception("抛出异常");
    }

    @GetMapping("getString")
    public Map<String, Object> getTestObject() {
        Map<String, Object> map = new HashMap<>();
        map.put("key1", "哈哈");
        map.put("key2", 15);
        map.put("key3", new Date());
        map.put("key4", "萨克继续杀跌发货偶极ALSDKHJOPFSIJD KJSADFijh sda空间啥的破i啊解放大卡九年撒地方计划");
        return map;
    }
}
